﻿<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="User.aspx.cs" Inherits="Manager_User_User" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td align="left">
<table border="1" bordercolor="#407db3" cellpadding="2" cellspacing="2" class="tbl_Comon-Search"
                        style="border-collapse: collapse; margin-left: 0px; width: 100%;" width="100%">
        <tr>
            <td align="center" nowrap="nowrap" rowspan="2" style="width: 87px" valign="middle">
                                <asp:Button ID="btnSearch" runat="server" CssClass="cssButton" Text="Tìm kiếm" Width="80px" OnClick="btnSearch_Click" /></td>
            <td nowrap="nowrap" rowspan="1" style="width: 109px" class="td_Title">
                                <asp:Label ID="Label1" runat="server" CssClass="lbl_Common-Search" Text="Họ tên"></asp:Label></td>
            <td nowrap="nowrap" rowspan="1" class="td_Control">
                                <asp:TextBox ID="txtName" runat="server" Height="20px" Width="98%"></asp:TextBox></td>
            <td nowrap="nowrap" class="td_Title" style="width: 80px">
                                <asp:Label ID="Label2" runat="server" CssClass="lbl_Common-Search" Text="Quyền hạn"></asp:Label></td>
            <td nowrap="nowrap" class="td_Control" style="width: 102px">
            <asp:DropDownList ID="ddlChuDe" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlChuDe_SelectedIndexChanged">
                            </asp:DropDownList></td>
        </tr>
    <tr>
        <td class="td_Title" nowrap="nowrap" rowspan="1" style="width: 109px">
            <asp:Label ID="Label3" runat="server" CssClass="lbl_Common-Search" Text="Tên đăng nhập"></asp:Label></td>
        <td class="td_Control" nowrap="nowrap" rowspan="1">
            <asp:TextBox ID="txtLogin" runat="server" Height="20px" Width="98%"></asp:TextBox></td>
        <td class="td_Title" nowrap="nowrap" style="width: 80px">
            <asp:Label ID="Label4" runat="server" CssClass="lbl_Common-Search" Text="Email"></asp:Label></td>
        <td class="td_Control" nowrap="nowrap">
            <asp:TextBox ID="txtEmail" runat="server" Height="20px" Width="97%"></asp:TextBox></td>
    </tr>
        <tr>
            <td align="left" colspan="5" nowrap="nowrap" valign="top">
            <asp:Button ID="btnAdd" runat="server" CssClass="cssButton" Text="Thêm mới" Width="80px" OnClick="btnAdd_Click" /></td>
        </tr>
    </table>
</td>
</tr>
<tr>
    <td>
    <asp:GridView ID="grv_Master" runat="server" CellPadding="2" BorderColor="#407DB3" BorderWidth="1px"  AutoGenerateColumns="False" Width="100%" AllowPaging="True" DataKeyNames="UserID" PageSize="20" OnRowDataBound="Grv_Product_RowDataBound" OnRowCreated="grv_Master_RowCreated1" OnRowDeleting="grv_Master_RowDeleting1" OnPageIndexChanging="grv_Master_PageIndexChanging">
        <Columns>
          
  <asp:TemplateField>  
          <ItemTemplate>
          <img id='imgedit' alt="Edit" runat="server" border="0" onclick="OpenUserDetail(this)" UserID='<%# Eval("UserID") %>'  AutID='<%# Eval("AutID") %>'   src="../../Images/Icon/cmdEdit.gif" style="cursor: pointer" />
            </ItemTemplate>               
          <ItemStyle  CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" Wrap="False"/>
          <HeaderStyle CssClass="cssBorderGrv" />
          </asp:TemplateField>    
                <asp:TemplateField>
                     <ItemTemplate>
			            <asp:LinkButton ID="lblDelete" Runat="server"   CommandName="delete" Text="<img src=../../Images/Icon/cmdDelete.gif border=0 alt=Delete > "></asp:LinkButton>			           
		            </ItemTemplate>
                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" />
                    <HeaderStyle CssClass="cssBorderGrv" />
       </asp:TemplateField>          
            <asp:TemplateField>
                <HeaderTemplate>
                    Họ tên
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("CusNm") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle  CssClass="cssBorderGrv" Width="40%"/>
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>            
            
              <asp:TemplateField>
                <HeaderTemplate>
                    Tên đăng nhập
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label55" runat="server" Text='<%# Eval("UserNm") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle  CssClass="cssBorderGrv" Width="25%"/>
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>
            
            <asp:TemplateField>
                <HeaderTemplate>
                    Email
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("Email") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle  CssClass="cssBorderGrv" Width="15%"/>
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>
            
          
            <asp:TemplateField>
                <HeaderTemplate>
                    Quyền hạn
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblsex" runat="server" Text='<%# Eval("AutNm") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left"  Width="15%" />
                <HeaderStyle CssClass="cssBorderGrv" /> 
            </asp:TemplateField>
           
        </Columns>
        <EmptyDataTemplate>
        Không tìm thấy dữ liệu
        </EmptyDataTemplate>
        
        <RowStyle CssClass="gvRowStyle" />
        <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
        <HeaderStyle CssClass="gvHeader" />
    </asp:GridView>

    </td>
</tr>
</table>

<script language="javascript" type="text/javascript">
function OpenUserDetail(obj)
{
    	    
	    var UserID=obj.getAttribute("UserID");
	    var AutID=obj.getAttribute("AutID");   
        var ddlChuDe=document.getElementById("<%= ddlChuDe.ClientID %>");   	    
	    var CodeID='<%= Request.QueryString["CodeID"]%>';
	    window.location.href="AddUser.aspx?CodeID="+CodeID+"&sAutID="+ddlChuDe.value+"&UserID="+UserID+"&AutID="+AutID;
	    

}
</script>
</asp:Content>

